package org.codingeasy.streamrecord.examples.service.impl;

import org.codingeasy.streamrecord.core.AttributeAccess;
import org.codingeasy.streamrecord.core.CurrentContext;
import org.codingeasy.streamrecord.core.InterceptMethodWrapper;
import org.codingeasy.streamrecord.core.annotation.Record;
import org.codingeasy.streamrecord.core.annotation.RecordService;
import org.codingeasy.streamrecord.core.annotation.RouteTarget;
import org.codingeasy.streamrecord.core.annotation.Search;
import org.codingeasy.streamrecord.core.matedata.RecordInfo;
import org.codingeasy.streamrecord.core.processor.ProcessorStrategy;
import org.codingeasy.streamrecord.examples.pojo.User;
import org.codingeasy.streamrecord.examples.service.UserService;
import org.springframework.core.annotation.Order;

/**
 * @author : KangNing Hu
 */
@RecordService
public class UserServiceImpl implements UserService {


  @Record("'这是一个简单的日志记录，用户的名称是：' + #user.name")
  @Override
  public void simple(@Search User user) {

  }



  @Record(value = "processor" , strategy = ProcessorStrategy.ROUTE_NAME)
  @RouteTarget(value = UserServiceImpl.class , paramTypes = {InterceptMethodWrapper.class,AttributeAccess.class})
  @Override
  public void route(@Search User user){

  }



  public String processor(User user  , InterceptMethodWrapper interceptMethodWrapper ,
      AttributeAccess attributeAccess){
     return "我是方法路由生成的" +user.getName();
  }
}
